package com.spring.turing.event;

import org.springframework.context.ApplicationListener;
import org.springframework.context.event.EventListener;
import org.springframework.stereotype.Component;

// @Lazy
@Component
public class OrderEventListener implements ApplicationListener<OrderEvent> {

	// 基于注解的
	@EventListener(OrderEvent.class)
	public void onApplicationEvent(OrderEvent event) {
		if (event.getName().equals("减库存")) {
			System.out.println("减库存.......");
		}
	}

}
